<?php
namespace app\admin\controller;
use app\admin\BaseController;
use think\response\Json;
use think\Session;

class Common extends BaseController
{
    //图片验证码
    public function captcha()
    {
        $model = new \app\admin\model\Captcha();
        return response()->contentType('image/jpeg')->data($model->getLoginCaptcha());
    }

    //异步校验验证码
    public function checkCaptcha(){
        $model = new \app\admin\model\Captcha();
        $check = $model->checkCaptcha(\app\admin\model\Captcha::LOGIN_CAPTCHA,$this->request->post('captcha'),false);
        return $check;
    }

    /**
     * 图标页面
     */
    public function icons(){
        return view('common/icons');
    }
}
